home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 80 / CD Actual 80 Julio-Agosto 2003.iso / Linux / LinuxGazette / lg / issue79 / misc / tougher / reply.hpp.txt < prev    next >
Encoding:
Text File  |  2002-08-14  |  1.7 KB  |  72 lines

  1. //
  2. //
  3. // Copyright 2002 Rob Tougher <robt@robtougher.com>
  4. //
  5. // This file is part of xmlrpc.
  6. //
  7. // xmlrpc is free software; you can redistribute it and/or modify
  8. // it under the terms of the GNU General Public License as published by
  9. // the Free Software Foundation; either version 2 of the License, or
  10. // (at your option) any later version.
  11. //
  12. // xmlrpc is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. // GNU General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU General Public License
  18. // along with xmlrpc; if not, write to the Free Software
  19. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20. //
  21. //
  22.  
  23.  
  24. // Definition of the reply class
  25.  
  26.  
  27. #ifndef _xmlrpc_reply_class_
  28. #define _xmlrpc_reply_class_
  29.  
  30.  
  31. #include <string>
  32. #include <vector>
  33.  
  34. #include "xml.hpp"
  35.  
  36. namespace xmlrpc
  37. {
  38.   class reply : public xml::persistable
  39.   {
  40.   public:
  41.  
  42.     reply ( const std::string value = "" );
  43.     virtual ~reply();
  44.  
  45.     //
  46.     // Methods you are interested in
  47.     //
  48.     std::string set_value ( const std::string s ) { m_value = s; }
  49.     std::string get_value() const { return m_value; }
  50.  
  51.     void add_error ( const std::string s ) { m_errors.push_back ( s ); }
  52.     std::string get_error ( const int ) const;
  53.     long get_error_count() const { return m_errors.size(); }
  54.  
  55.  
  56.     //
  57.     // Methods used internally by
  58.     // the framework
  59.     //
  60.     virtual std::string get_xml() const;
  61.     virtual void load_xml ( const std::string );
  62.     std::string terminator() const { return "abcdef_reply_end_abcdef"; }
  63.  
  64.   private:
  65.  
  66.     std::vector<std::string> m_errors;
  67.     std::string m_value;
  68.   };
  69. };
  70.  
  71. #endif
  72.